home *** CD-ROM | disk | FTP | other *** search
/ USGS: Oil & Gas Fields of Asia Pacific / USGS Maps Showing Geology, Oil & Gas Fields of Asia Pacific.iso / pc / ASPAC / VIEWPC03 / SCRIPTS / PANTOOL.AVE < prev    next >
Text File  |  1999-03-10  |  3KB  |  94 lines

  1. ' pantool.ave
  2. ' Integrates the Arcview View.PanTool system script
  3. ' to label geology on the fly as the view is panned
  4. ' D.W. Steinshouer - GeoLukas for U.S.G.S. 
  5. ' World Energy Project
  6. ' Thomas Ahlbrandt   Project Chief
  7.  
  8.  
  9. region3 = av.GetProject
  10. region3.SetModified(true)
  11. theView = av.GetActiveDoc
  12. theView.GetDisplay.Pan
  13.  
  14. leg = region3.FindDoc("Geologic Legend")
  15. if (theView <> leg) then
  16.   
  17.   
  18.   av.ShowMsg("Labeling geologic age ...")
  19.   av.ShowStopButton
  20.   av.SetStatus(0)
  21.   
  22.   theTheme = theView.GetThemes.Get(5)
  23.   theTheme.SetActive(true)
  24.   theTheme.GetGraphics.SelectLabels
  25.   theTheme.GetGraphics.Invalidate
  26.   theView.GetGraphics.ClearSelected
  27.  
  28.    ' Determines the scale of zoomed view
  29.  
  30.    size = theView.GetDisplay.ReturnVisExtent
  31.    tall = size.GetHeight
  32.    long = size.GetWidth
  33.  
  34.     ' Filters scale and draws labels
  35.  
  36.      if ((tall < 889000) AND (long < 1227670)) then
  37.        agelabel = Labeler.Make(size)
  38.        agelabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  39.        agelabel.SetLabelWeight(#LABEL_WEIGHT_LOW)
  40.        agesymbol = TextSymbol.Make
  41.        agesymbol.SetFont(Font.Make("Univers","Medium"))
  42.         if ((tall < 44450) AND (long < 61383)) then
  43.           agesymbol.SetSize(15)
  44.         elseif ((tall < 88900) AND (long < 122767)) then
  45.           agesymbol.SetSize(12)
  46.         elseif ((tall < 222250) AND (long < 306917)) then
  47.           agesymbol.SetSize(11)
  48.         elseif ((tall < 444500) AND (long < 613835)) then
  49.           agesymbol.SetSize(10)
  50.         elseif ((tall < 666751) AND (long < 920752)) then
  51.           agesymbol.SetSize(9)
  52.        else
  53.     agesymbol.SetSize(8)
  54.        end
  55.      theTheme.SetLabelTextSym(agesymbol)
  56.      agelabel.Load(theTheme)
  57.      theView.GetAutoLabels(agelabel,true)
  58.     else
  59.      theTheme.GetGraphics.SelectLabels
  60.      theTheme.GetGraphics.Invalidate
  61.      theView.GetGraphics.ClearSelected
  62.     end
  63.     
  64.     t2 = theView.GetThemes.Get(0)
  65.     t2.SetActive(true)
  66.     t2.GetGraphics.SelectLabels
  67.     t2.GetGraphics.Invalidate
  68.     theView.GetGraphics.ClearSelected
  69.  
  70.     citylabel = Labeler.Make(size)
  71.     citylabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  72.     citylabel.SetLabelWeight(#LABEL_WEIGHT_HIGH)    
  73.     citysymbol = TextSymbol.Make
  74.     citysymbol.SetFont(Font.Make("Univers","Italic"))
  75.     citysymbol.SetSize(10)
  76.     t2.SetLabelTextSym(citysymbol)
  77.     citylabel.Load(t2)
  78.     theView.GetAutoLabels(citylabel,true)
  79.  
  80.     ts = theView.GetThemes
  81.       for each t in ts
  82.         t.SetActive(false)
  83.       end
  84.  
  85.  
  86. av.SetStatus(100)
  87. av.ClearMsg
  88.     
  89.    end
  90.  
  91.         
  92.  
  93.  
  94.